home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / CNOTES.TXT < prev    next >
Text File  |  2019-04-13  |  2KB  |  52 lines

  1. A Few Useful Things to Know About Power C
  2.  
  3. I've been working with Power C for a while now, and I've learned a 
  4. few tricks I'd like to share with others.  Hopefully we can help
  5. each other learn this fascinating new language.
  6.  
  7. 1. The disk-swapping discussed in the documentation for those of us
  8.    with one drive really isn't necessary; just move the first seven
  9.    files (shell-translator), plus stdio.h and dir.h from the Editor/
  10.    Compiler disk to your work disk.  The new procedure is then to
  11.    always have the work disk in the drive, except when linking in 
  12.    the function libraries.  When you compile, use the syntax:
  13.  
  14.         cc -p filename
  15.  
  16.    This will go through the entire compilation process without 
  17.    asking you to change disks.
  18.  
  19. 2. The "trim" program will trim further an already trimmed file, but
  20.    the resulting code doesn't always work!  Only trim your object
  21.    files once!
  22.  
  23. 3. When passing a variable address to a function (with the intent of
  24.    modifying the value of the original variable directly), declare
  25.    the original variable as "static".  Power C moves the first 32 
  26.    bytes of variables to be passed (unless declare    static) into zero
  27.    page, so an "auto" variable won't really be at the address which
  28.    was passed.
  29.  
  30. 4. As you write your own functions which can be used in multiple
  31.    programs, build your own function libraries.  Compile and link
  32.    the program "lib.c" on the Power C work disk, then run it.
  33.    Library files must end with ".l".  Once you have a library file
  34.    you can give the linker the name of the library file instead of 
  35.    the names of individual object modules.
  36.  
  37. 5. The speed of the standard 1541 di     drive is horrible for such a
  38.    disk-based application; I ran out and bought BetterWorking's Turbo
  39.    Load and Save cartridge as recommended in the documentation; it 
  40.    works very well as claimed.
  41.  
  42. 6. For those of us who need a good book to get us started, I can
  43.    heartily recommend "C Primer Plus", by Waite, Prata, and Martin,
  44.    published by Howard W. Sams & Company.  It's more expensive than
  45.    most, but well worth it (it's 558 pages!).
  46.  
  47.    Good luck,
  48.  
  49.    Steve Grace
  50.    (70726,306)
  51.  
  52.